"""
pip install PyPDF2 -i https://pypi.tuna.tsinghua.edu.cn/simple --root-user-action=ignore
"""

import PyPDF2

def extract_text_from_pdf(pdf_path):
    with open(pdf_path, 'rb') as file:
        reader = PyPDF2.PdfReader(file)
        content = ''
        for page in reader.pages:
            content += page.extract_text()
        return content


# 使用函数
path = 'c:/Tmp/credit/2025032916005323784845.pdf'
text = extract_text_from_pdf(path)
print(text)